<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>店铺订单修改页-${web.name}${web.additionalTitle}</title>
<link href="${root}/u/css/main.css" type="text/css" rel="stylesheet" />
<link href="${root}/u/css/memeber.css" type="text/css" rel="stylesheet" />
<link href="${root}/u/css/buy.css" type="text/css" rel="stylesheet" />
<link href="${root}/u/css/order.css" type="text/css" rel="stylesheet" />
<script src="${sysResRoot}/jquery.js" type="text/javascript"></script>
<script type="text/javascript">
	$(function() {
		$("#jvForm").validate();
	});
	function changeFreight() {
		var ss = parseFloat($("#productPrice").html());
		$("#total").html("");
		$("#freightend").html("");
		$("#totalend").html("");
		ss += parseFloat($("#freight").val());
		var sf = parseFloat($("#freight").val());
		$("#total").html(ss);
		$("#freightend").html(sf);
		$("#totalend").html(ss);
	}
	function changePrice() {
		var totalPrice = 0.0;
		$("#[id^='itemPrice_']").each(function() {
			var ss = parseFloat(jQuery(this).val());
			var h = jQuery(this).attr("id");
			var index = h.split("_")[1];
			var count = $("#itemCount_" + index).val();
			$("#subtotal_" + index).html("");
			$("#subtotal_" + index).html(count * ss);
			totalPrice += count * ss;
		});
		$("#totalPrice").val("");
		$("#totalPrice").val(totalPrice);
		$("#productPrice").html("");
		$("#productPrice").html(totalPrice);
		$("#total").html("");
		$("#totalend").html("");
		$("#total").html(parseFloat($("#freight").val()) + totalPrice);
		$("#totalend").html(parseFloat($("#freight").val()) + totalPrice);
	}

	function changeCount() {
		var totalWeight = 0.0;
		$("#[id^='itemCount_']").each(function() {
			var ss = parseFloat(jQuery(this).val());
			var h = jQuery(this).attr("id");
			var index = h.split("_")[1];
			var weight = $("#itemWeight_" + index).html();
			totalWeight += ss * weight;
		});
		setTimeout(function() {
			changePrice()
		}, 1000);
	}
</script>
</head>
<body>
[#include "../include/shop_top.html"/]
<div class="w1168">
	[#include "店铺中心_导航.html"/]
	<div id="container" class="user_right">
		<div class="user_title2">订单修改</div>
        <div class="clear10"></div> 
        <form class="ropt">
        <input type="submit" class="menu_ok2" value="返回列表"
        onclick="this.form.action='list.jspx?orderId=${order.id}&pageNo={pageNo}';" />
        </form>
        <div class="clear20"></div>
		<form method="post" action="editOrder.jspx" id="jvForm">
        <div class="order_infod mt10">
        <div class="order_conhead">
        <ul>
        <li>订单编号：<span style="color: #fe0000;">${order.code}</span></li>
        <li>下单日期：<span style="color: #fe0000;">${order.createTime}</span></li>
        <li>订单状态<span style="color: #fe0000;"> [#if
        order.status=3] [@s.m "order.status.${order.status}"/] [#elseif
        order.status=4] [@s.m "order.status.${order.status}"/] [#elseif
        order.paymentStatus=1] [@s.m
        "order.paymentStatus.${order.paymentStatus}"/] &nbsp;[#if
        order.shippingStatus=2] [@s.m
        "order.shippingStatus.${order.shippingStatus}"/] [/#if] [#elseif
        order.paymentStatus=2] [@s.m
        "order.paymentStatus.${order.paymentStatus}"/] &nbsp;[@s.m
        "order.shippingStatus.${order.shippingStatus}"/] [/#if] </span></li>
        </ul>
        </div>
        <div class="order_continf">
        <dl>
        <dt style="color:#06F">收货人信息</dt>
        <dd>收货人：${order.receiveName!}</dd>
        <dd>收货地址：${order.receiveAddress!}</dd>
        <dd>手机号码：${order.receiveMobile!}</dd>
        <dd>邮政编码：${order.receiveZip!}</dd>
        </dl>
        <dl>
        <dt style="color:#06F">配送信息</dt>
        <dd>
        送货方式： <select id="shippingId" name="shippingId" class="address_input"> [#list
        shippingList as shipping]
        <option value="${shipping.id}" [#if
        shippingId??]
        [#if shippingId==shipping.id]
        selected="selected"[/#if]
        [/#if]>
        ${shipping.name!}</option> [/#list]
        </select>
        </dd>
        <dd>
        运费：&yen; <input type="text" id="freight" name="freight"
        value="${order.freight}" class="required address_input"
        onchange="changeFreight();" style="width: 70px;" maxlength="20" />
        重量: <span id="weight">${order.weight}</span> g
        </dd>
        <dd>
        订单总额：&yen;<span id="total">${order.total!}</span>
        <input type="hidden" class="address_input" id="totalPrice" name="totalPrice" value="${order.productPrice!0}"/>
        </dd>
        <dd>物流单号: ${order.invoiceNo!}</dd>
        </dl>
        <dl>
        <dt style="color:#06F">支付信息</dt>
        <dd>支付状态：[#if order.status=3][@s.m
        "order.status.${order.status}"/][#elseif order.status=4][@s.m
        "order.status.${order.status}"/] [#elseif
        order.paymentStatus=1][@s.m
        "order.paymentStatus.${order.paymentStatus}"/]&nbsp;[#if
        order.shippingStatus=2][@s.m
        "order.shippingStatus.${order.shippingStatus}"/][/#if] [#elseif
        order.paymentStatus=2][@s.m
        "order.paymentStatus.${order.paymentStatus}"/]&nbsp;[@s.m
        "order.shippingStatus.${order.shippingStatus}"/][/#if]</dd>
        <dd>支付方式： ${order.payment.name}</dd>
        </dl>
        <dl>
        <dt style="color:#06F">积分信息</dt>
        <dd>
        可获积分：￥${order.score!0}[#if
        order.status==20](可用积分)[#else](冻结中)[/#if] <a class="hblue"
        href="${base}/xsrm/20.htm" target="_blank" style="color:#F00">查看积分规则</a>
        </dd>
        </dl>
        
        <div class="order_info_list mt10">
        <h3 style="color:#06F">商品信息</h3>
        <div class="order_info_list mt10" style="border:1px solid #ccc;overflow-y:auto; overflow-x:auto;height:270px;">
        <table cellspacing="1" cellpadding="0" border="0"
        class="product_table">
        <tbody>
        <tr>
        <th>商品编号</th>
        <th>商品图片</th>
        <th>商品名称</th>
        <th>成交价</th>
        <th>单重</th>
        <th>数量</th>
        <th>金额小计</th>
        </tr>
        [#list order.items as item]
        <tr>
        <td align="center" width="50px;">[#if
        item.product.productExt.code??]${item.product.productExt.code}[/#if]</td>
        <td class="pro"><a class="pic"
        href="http://www.yihaodian.com/product/1845672_3"
        target="_blank"><img
        src="${root}${item.product.productExt.coverImg!}" /></a></td>
        <td class="pro1" align="left">
        <p>
        <a href="http://www.yihaodian.com/product/1845672_3"
        target="_blank">${item.product.name}&nbsp;[#if
        item.productFash??]${item.productFash.nature!}[/#if]</a>
        </p>
        </td>
        <td align="center" width="60">
        [#if item.productFash??]
        <input type="text" id="itemPrice_${item.id}" name="itemPrice" value="${item.salePrice!}" onchange="changePrice();"
        style="width: 60px;" class="address_input" /> [#else] <input type="text" id="itemPrice_${item.id}" name="itemPrice"
        value="${item.salePrice!}" onchange="changePrice();" style="width: 60px;" class="address_input" /> [/#if]
        </td>
        <td align="center" width="40"><span
        id="itemWeight_${item.id}">${item.product.weight}</span></td>
        <td align="center" width="40">
        <input type="hidden" name="itemId" value="${item.id}" class="address_input" />
        <input type="text" id="itemCount_${item.id}" name="itemCount" value="${item.count}" onchange="changeCount();"
        style="width: 40px;" class="address_input" />
        </td>
        <td align="center" width="70"><span
        id="subtotal_${item.id}">${item.salePrice*item.count!}</td>
        </tr>
        [/#list]
        </tbody>
        </table>
        </div>
        <div class="order_crash">
        <ul>
        <li class="order_crash_total" align="left;">商品总金额:&nbsp;&yen;<span
        id="productPrice">${order.productPrice!}</span></li>
        <li><span>运费：</span>+&yen;<span id="freightend">${order.freight!}</span></li>
        <li class="order_crash_total"><span>发货前需先支付：</span><em>&yen;<span
        id="totalend">${order.total!}</span></em></li>
        
        </ul>
        </div>
        <div class="order_crash" align="center">
        <input type="hidden" name="id" value="${order.id}"/>
        <input type="submit" value="提交" class="menu_ok"/>&nbsp;&nbsp;&nbsp;<input type="reset" value="重置" class="menu_ok"/>
        </div>
        </div>
        </div>
        </div>
		</form>
		<div class="clear20"></div>
	</div>
</div>
[#include "../include/footer_information_bar.html"/]
</body>
</html>